package active.commond;

import active.commond.concretecommond.LightOffCommond;
import active.commond.concretecommond.LightOnCommond;
import active.commond.concretecommond.TVOffCommond;
import active.commond.concretecommond.TVOnCommond;
import active.commond.invoker.*;
import active.commond.reciver.LightReciver;
import active.commond.reciver.TVReciver;

public class ClientCommond {
    public static void main(String[] args) {
        RemoteInvoker2 remoteInvoker2 = new RemoteInvoker2();

        LightReciver lightReciver = new LightReciver();
        remoteInvoker2.setCommond(0, new LightOnCommond(lightReciver), new LightOffCommond(lightReciver));

        remoteInvoker2.pressButtonOn(0);
        remoteInvoker2.pressButtonOff(0);
        remoteInvoker2.undo();

        System.out.println(" ================ ");
        TVReciver tvReciver = new TVReciver();
        remoteInvoker2.setCommond(1, new TVOnCommond(tvReciver), new TVOffCommond(tvReciver));
        remoteInvoker2.pressButtonOn(1);
        remoteInvoker2.undo();
    }
}
